#include <bits/stdc++.h>

#define ll long long
#define YES cout << "Yes" << endl
#define NO cout << "No" << endl
const int INF = 1e9;
using namespace std;
/*思考
简化问题：将(k+n-1)/n(上取整)分到一行，这一行最长工作台长度即为答案
*/
void solve()//O(1)
{
    int n = 0, m = 0, k = 0;
    cin >> n >> m >> k;
    int x = (k + n - 1) / n; // 需要放置的桌子数量,不放石头，放空格
    int max_len = (x + (m - x + 1) - 1) / (m - x + 1);
    cout << max_len << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t = 0;
    cin >> t;
    while (t--)
        solve();
    return 0;
}